﻿using Microsoft.SharePoint.Administration;
using Trentacular.SharePoint.Deployment.Model;

namespace Trentacular.SharePoint.Deployment.Data.Proxy
{
    public class SolutionFeatureDefinitionsLazyInitializer : BaseDomainListLazyInitializer<Solution, FeatureDefinition>
    {
        protected override object InitializeTarget()
        {
            var spFarm = SPFarm.Local;
            var spSolution = spFarm.Solutions[Owner.Id];

            return spSolution.ExtractFeatureDefinitions(Owner);
        }
    }
}
